package com.dji.ux.sample.VirtualSticks.Panorama;

import java.util.TimerTask;

import dji.common.error.DJIError;
import dji.common.flightcontroller.virtualstick.FlightControlData;
import dji.common.util.CommonCallbacks;
import dji.sdk.flightcontroller.FlightController;

/**
 * @description： 摇杆全景计时器任务类
 * @author： HaolinLv
 * @time： 2022/1/3 20:13
 */


public class VirtualStickPanoramaTask extends TimerTask {

    private FlightController mFlightController;
    public float mPitch, mRoll, mYaw, mThrottle = 0;

    public VirtualStickPanoramaTask(FlightController flightcontroller) {

        mFlightController = flightcontroller;
    }

    @Override
    public void run() {
        if (mFlightController != null) {
            mFlightController.sendVirtualStickFlightControlData(
                    new FlightControlData(
                            mPitch, mRoll, mYaw, mThrottle
                    ), new CommonCallbacks.CompletionCallback() {
                        @Override
                        public void onResult(DJIError djiError) {

                        }
                    }
            );
        }
    }
}

